#include <stdio.h>

double Tax(double income, double threshold);

int main()
{
    double income, threshold, tax;
    scanf("%lg%lg", &income, &threshold);
    tax = Tax(income, threshold);
    printf("%.2f\n", tax);
    return 0;
}

double Tax(double income, double threshold)
{
    if (income <= threshold)
    {
        return 0;
    }
    else
    {
        income = income - threshold;
        if (income < 1500)
        {
            return income * 0.03;
        }
        else if (income < 4500)
        {
            return 1500 * 0.03 + (income - 1500) * 0.1;
        }
        else if (income < 9000)
        {
            return 1500 * 0.03 + 3000 * 0.1 + (income - 4500) * 0.2;
        }
        else if (income < 35000)
        {
            return 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + (income - 9000) * 0.25;
        }
        else if (income < 55000)
        {
            return 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + (35000 - 9000) * 0.25 + (income - 35000) * 0.3;
        }
        else if (income < 80000)
        {
            return 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + (35000 - 9000) * 0.25 + 20000 * 0.3 + (income - 55000) * 0.35;
        }
        else
        {
            return 1500 * 0.03 + 3000 * 0.1 + 4500 * 0.2 + (35000 - 9000) * 0.25 + 20000 * 0.3 + 25000 * 0.35 + 0.45 * (income - 80000);
        }
    }
}